package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.SysLearningPosterVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysLearningPosterMapper;
import com.ruoyi.system.domain.SysLearningPoster;
import com.ruoyi.system.service.ISysLearningPosterService;

import javax.annotation.Resource;

/**
 * 学习海报Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-08
 */
@Service
public class SysLearningPosterServiceImpl implements ISysLearningPosterService 
{
    @Resource
    private SysLearningPosterMapper sysLearningPosterMapper;

    /**
     * 查询学习海报
     * 
     * @param posterId 学习海报主键
     * @return 学习海报
     */
    @Override
    public SysLearningPoster selectSysLearningPosterByPosterId(Long posterId)
    {
        return sysLearningPosterMapper.selectByPosterId(posterId);
    }

    /**
     * 查询学习海报列表
     * 
     * @param sysLearningPoster 学习海报
     * @return 学习海报
     */
    @Override
    public List<SysLearningPosterVo> selectSysLearningPosterList(SysLearningPoster sysLearningPoster)
    {
        return sysLearningPosterMapper.selectList(sysLearningPoster);
    }

    /**
     * 新增学习海报
     * 
     * @param sysLearningPoster 学习海报
     * @return 结果
     */
    @Override
    public int insertSysLearningPoster(SysLearningPoster sysLearningPoster)
    {
        sysLearningPoster.setCreateTime(DateUtils.getNowDate());
        return sysLearningPosterMapper.insertSysLearningPoster(sysLearningPoster);
    }

    /**
     * 修改学习海报
     * 
     * @param sysLearningPoster 学习海报
     * @return 结果
     */
    @Override
    public int updateSysLearningPoster(SysLearningPoster sysLearningPoster)
    {
        sysLearningPoster.setUpdateTime(DateUtils.getNowDate());
        return sysLearningPosterMapper.updateSysLearningPoster(sysLearningPoster);
    }

    /**
     * 批量删除学习海报
     * 
     * @param posterIds 需要删除的学习海报主键
     * @return 结果
     */
    @Override
    public int deleteSysLearningPosterByPosterIds(Long[] posterIds)
    {
        return sysLearningPosterMapper.deleteSysLearningPosterByPosterIds(posterIds);
    }

    /**
     * 删除学习海报信息
     * 
     * @param posterId 学习海报主键
     * @return 结果
     */
    @Override
    public int deleteSysLearningPosterByPosterId(Long posterId)
    {
        return sysLearningPosterMapper.deleteSysLearningPosterByPosterId(posterId);
    }

    @Override
    public List<SysLearningPosterVo> selectList(SysLearningPoster sysLearningPoster) {
        return sysLearningPosterMapper.selectList(sysLearningPoster);
    }
}
